package Hw;

import java.util.Scanner;

/*
    【编号：804】
    键盘录入一个字符串，统计该字符串中大写字母字符，小写字母字符，数字字符出现的次数(不考虑其他字符)
 */
public class Hw804 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        char[] sArray = sc.nextLine().toCharArray();
        int upper = 0,lower = 0,num = 0;

        for (int i = 0; i < sArray.length; i++) {
            if (sArray[i] >= 'A' && sArray[i] <= 'Z')upper++;
            if (sArray[i] >= 'a' && sArray[i] <= 'z')lower++;
            if (sArray[i] >= '0' && sArray[i] <= '9')num++;
        }
        System.out.println("大写字母字符出现次数" + upper);
        System.out.println("小写字母字符出现次数" + lower);
        System.out.println("数字字符出现次数" + num);
    }
}
